package com.sh.caryr.erp.entity.product;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sh.caryr.erp.entity.enums.ProductTypeEnum;
import com.sh.caryr.erp.entity.stock.Sku;
import com.sh.caryr.erp.util.ERPConstants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("erp_product_spec")
public class ProductSpec implements Serializable {

    private static final long serialVersionUID = 1L;

    @Excel(name = "规格ID", isImportField = "true_st")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String coco;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long shopId;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;

    private ProductTypeEnum type;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long skuId;

    private String img;

    private String productName;

    @Excel(name = "规格名称", isImportField = "true_st")
    private String name;

    private String code;

    private Float purchasePrice;

    private Float salePrice;


    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    @TableField(exist = false)
    private Sku sku;

    @TableField(exist = false)
    private List<CombNum> combNumList;

    @Builder.Default
    private int isActive = ERPConstants.ENITYT_ACTIVE;
}
